//
//  TitleImagCell.m
//  趣·美食
//
//  Created by dllo on 15/9/28.
//  Copyright (c) 2015年 金旭. All rights reserved.
//

#import "TitleImagCell.h"


@interface TitleImagCell ()

@property (nonatomic, strong) UIImageView *titleImageView;

@end

@implementation TitleImagCell



- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.titleImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.titleImageView];
        
    }
    
    return self;
}

- (void)setImageName:(NSString *)imageName {
    
    if (_imageName != imageName) {
        
        _imageName = imageName;
    }
    if (self.imageName) {
        [self.titleImageView setImageWithURL:[NSURL URLWithString:self.imageName] placeholderImage:[UIImage imageNamed:@"category_1"]];
    }
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.titleImageView.frame = self.contentView.frame;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
